// Control types
#define CT_STATIC 0
#define CT_BUTTON 1
#define CT_EDIT 2
#define CT_SLIDER 3
#define CT_COMBO 4
#define CT_LISTBOX 5
#define CT_TOOLBOX 6
#define CT_CHECKBOXES 7
#define CT_PROGRESS 8
#define CT_HTML 9
#define CT_STATIC_SKEW 10
#define CT_ACTIVETEXT 11
#define CT_TREE 12
#define CT_STRUCTURED_TEXT 13
#define CT_CONTEXT_MENU 14
#define CT_CONTROLS_GROUP 15
#define CT_SHORTCUT_BUTTON 16
//Arma 2 - textured button
#define CT_XKEYDESC 40
#define CT_XBUTTON 41
#define CT_XLISTBOX 42
#define CT_XSLIDER 43
#define CT_XCOMBO 44
#define CT_ANIMATED_TEXTURE 45
#define CT_OBJECT 80
#define CT_OBJECT_ZOOM 81
#define CT_OBJECT_CONTAINER 82
#define CT_OBJECT_CONT_ANIM 83
#define CT_LINEBREAK 98
#define CT_USER 99
#define CT_MAP 100
#define CT_MAP_MAIN 101
// Static styles
#define ST_POS 0x0F
#define ST_HPOS 0x03
#define ST_VPOS 0x0C
#define ST_LEFT 0x00
#define ST_RIGHT 0x01
#define ST_CENTER 0x02
#define ST_DOWN 0x04
#define ST_UP 0x08
#define ST_VCENTER 0x0c
#define ST_TYPE 0xF0
#define ST_SINGLE 0
#define ST_MULTI 16
#define ST_TITLE_BAR 32
#define ST_PICTURE 48
#define ST_FRAME 64
#define ST_BACKGROUND 80
#define ST_GROUP_BOX 96
#define ST_GROUP_BOX2 112
#define ST_HUD_BACKGROUND 128
#define ST_TILE_PICTURE 144
#define ST_WITH_RECT 160
#define ST_LINE 176
#define ST_SHADOW 0x100
#define ST_NO_RECT 0x200
#define ST_KEEP_ASPECT_RATIO 0x800
#define ST_TITLE ST_TITLE_BAR + ST_CENTER
// Slider styles
#define SL_DIR 0x400
#define SL_VERT 0
#define SL_HORZ 0x400
#define SL_TEXTURES 0x10
// Listbox styles
#define LB_TEXTURES 0x10
#define LB_MULTI 0x20
#define FontM "Zeppelin32"

#define true 1
#define false 0



// ------- CUSTOM CONSTANTS ---------------------------------------------------

#define ControlFontSize 0.025
#define MATRIX_GREEN 0,0.7,0
#define ButtonHeight ControlFontSize+0.015

// ------------------- CONSTANT END -------------------------------------------

// --------------------- COMBOBOX CONTROL -------------------------------------

class RscListCtrl {
    idc = -1;
    style = ST_LEFT;

    // position
    x = 0.1;
    y = 0.1;
    w = 0.2;

    // size
    sizeEx = ControlFontSize;
    rowHeight = ControlFontSize;
    wholeHeight = 4 * ControlFontSize;

    // font
    font = FontM;

    // colors
    color[] = {Dlg_Color_White, 1};
    colorText[] = {Dlg_Color_Black, 1};
    colorBackground[] = {Dlg_Color_White, 1};
    colorSelect[] = {Dlg_Color_White, 1};
    colorSelectBackground[] = {Dlg_Color_Black, 1};
	colorFocused[] = {1,0,0,0};
	colorShadow[] = {0.6, 0.6, 0.6, 0.8};
	colorBorder[] = {0.5,0,0,1};
	
	//
	type = CT_LISTBOX;
	
	offsetX = 0.003;
	offsetY = 0.003;
	offsetPressedX = 0.002;
	offsetPressedY = 0.002;
	
	borderSize = 1;
	soundselect[]={};
	SoundExpand[]={"\ca\ui\data\sound\new1", 0.15, 1};
	SoundCollapse[]={"\ca\ui\data\sound\new1", 0.15, 1};
	soundEnter[] = {"\ca\ui\data\sound\mouse2", 0.15, 1};
	soundPush[] = {"\ca\ui\data\sound\new1", 0.15, 1};
	soundClick[] = {"\ca\ui\data\sound\mouse3", 0.15, 1};
	soundEscape[] = {"\ca\ui\data\sound\mouse1", 0.15, 1};
	maxHistoryDelay = 1.0;
	autoScrollSpeed = -1;
	autoScrollDelay = 5;
	autoScrollRewind = 0;

 	class ScrollBar
	{
		color[] = {0.5,0,0,1};
		colorActive[] = {0.5,0,0,1};
		colorDisabled[] = {0.5,0,0,1};
		thumb = "\ca\ui\data\ui_scrollbar_thumb_ca.paa";
		arrowFull = "\ca\ui\data\ui_arrow_top_active_ca.paa";
		arrowEmpty = "\ca\ui\data\ui_arrow_top_ca.paa";
		border = "\ca\ui\data\ui_border_scroll_ca.paa";
	};

	//

};

class RscCombo : RscListCtrl {
    type = CT_COMBO;

    h = ControlFontSize;
	
	arrowEmpty = "\ca\ui\data\ui_arrow_top_ca.paa";
	arrowFull = "\ca\ui\data\ui_arrow_down_active_ca.paa";

};

class RscListBox : RscListCtrl {
    type = CT_LISTBOX;

    h = 4 * ControlFontSize;

    //style = LB_TEXTURES;
};

class RscSlider {
	 idc = -1; 
	 type = CT_SLIDER; 
	 style = SL_HORZ; 
	 x = 0.4; 
	 y = 0.2; 
	 w = 0.3; 
	 h = 0.025; 
	 color[] = { 1, 1, 1, 1 }; 
	 coloractive[] = { 1, 0, 0, 0.5 }; 
	 // This is an ctrlEventHandler to show you some response if you move the sliderpointer. 
	 onSliderPosChanged = "hint format[""%1"",_this];"; 
 };

 
 class MyRscCheckBoxes { 
	 idc =-1; 
	 type = CT_CHECKBOXES; 
	 style = ST_CENTER; 
	 x = 0.1; 
	 y = 0.18; 
	 w = 0.15; h = 0.15; 
	 colorText[] = {1, 0, 0, 1}; 
	 color[] = {0, 1, 0, 1}; //seems nothing to change, but define to avaoid errors 
	 colorTextSelect[] = {0, 0.8, 0, 1}; 
	 colorSelect[] = {0, 0, 0, 1}; 
	 colorTextDisable[] = {0.4, 0.4, 0.4, 1}; 
	 colorDisable[] = {0.4, 0.4, 0.4, 1}; 
	 font = "Zeppelin32"; 
	 sizeEx = 0.0208333; 
	 rows = 3; 
	 columns = 2; 
	 strings[] = {"Entry 1","Entry 2","Entry 3","Entry 4","Entry 5","Entry 6"};
	 //Simple UI event handler to show response on clicks 
	 onCheckBoxesSelChanged = "hint format[""Checkbox change:\n%1\nEntry#: %2\nNewState: %3"",(_this select 0),(_this select 1),(_this select 2)];";
 }; 
 
//-------------------------------- BACK ---------------------------------------

class RscBack {
    idc = -1;
    type = CT_STATIC;
    style = ST_CENTER;

    colorText[] = {0, 0, 0, 1};
    colorBackground[] = {1, 1, 1, 0.75};

    x = 0;
    y = 0;
    w = 0.1;
    h = 0.1;

    // font
    font = FontM;
    sizeEx = 0.05;

    text = "";
};

//-------------------------------- BUTTON ---------------------------------------


class RscButton {
    idc = -1;
    type = CT_BUTTON;
    style = ST_LEFT;
    default = false;
    font = FontM;
    sizeEx = ControlFontSize;
    colorText[] = {0, 0, 0, 1};
    colorFocused[] = {0.9, 0.9, 0.9, 1}; // border color for focused state
    colorDisabled[] = {0.5, 0.5, 0.5, 0.7}; // text color for disabled state
    colorBackground[] = {1, 1, 1, 0.8};
    colorBackgroundDisabled[] = {1, 1, 1, 0.5};    // background color for disabled state
    colorBackgroundActive[] = { 1, 1, 1, 1 };    // background color for active state
    offsetX = 0.003;
    offsetY = 0.003;
    offsetPressedX = 0.002;
    offsetPressedY = 0.002;
    colorShadow[] = {0, 0, 0, 0.5};
    colorBorder[] = {0, 0, 0, 1};
    borderSize = 0;
    soundEnter[] = {"", 0, 1};   // no sound
    soundPush[] = {"buttonpushed.ogg", 0.1, 1};
    soundClick[] = {"", 0, 1};   // no sound
    soundEscape[] = {"", 0, 1};  // no sound
//    x = 0.4;
//    y = 0.475;
//    w = 0.2;
    h = ControlFontSize+0.015;
    text = "RscButton";
    action = "player globalChat ""RscButton default action""";
};
//---------------------- MAP CONTROL ------------------------------------------

class RscMapControl {
    type = CT_MAP_MAIN;
    idc = -1;
    style = ST_PICTURE;

    x = 0.1;
    y = 0.1;
    w = 0.3;
    h = 0.3;

    colorSea[] = {0.56, 0.8, 0.98, 0.5};
    colorForest[] = {0.6, 0.8, 0.2, 0.5};
    colorRocks[] = {0.6, 0.45, 0.27, 0.4};
    colorCountlines[] = {0.7, 0.55, 0.3, 0.6};
    colorCountlinesWater[] = {0, 0.53, 1, 0.5};
    colorMainCountlines[] = {0.65, 0.45, 0.27, 1};
    colorMainCountlinesWater[] = {0, 0.53, 1, 1};
    colorPowerLines[] = {Dlg_Color_Black, 1};
    colorLevels[] = {Dlg_Color_Black, 1};
    colorForestBorder[] = {0.4, 0.8, 0, 1};
    colorRocksBorder[] = {0.6, 0.45, 0.27, 0.4};
    colorNames[] = {Dlg_Color_Black, 1};
    colorInactive[] = {Dlg_Color_White, 0.5};
    colorBackground[] = {Dlg_Color_White, 1};
    colorText[] = {Dlg_Color_White, 1};
	
	colorOutside[] = {1, 1, 1, 1};
	colorRailWay[] = {1, 0, 0, 0.8};
	
    font = "Zeppelin32";
    sizeEx = 0.09;

    fontLabel = "Zeppelin32";
    sizeExLabel = 0.0386458;
    fontGrid = "Zeppelin32";
    sizeExGrid = 0.0286458;
    fontUnits = "Zeppelin32";
    sizeExUnits = 0.0286458;
    fontNames = "Zeppelin32";
    sizeExNames = 0.0286458;
    fontInfo = "Zeppelin32";
    sizeExInfo = 0.0286458;
    fontLevel = "Zeppelin32";
    sizeExLevel = 0.0286458;

    ptsPerSquareSea = 6;
    ptsPerSquareTxt = 8;
    ptsPerSquareCLn = 8;
    ptsPerSquareExp = 8;
    ptsPerSquareCost = 8;
    ptsPerSquareFor = "4.0f";
    ptsPerSquareForEdge = "10.0f";
    ptsPerSquareRoad = 2;
    ptsPerSquareObj = 10;

    text = "\ca\ui\data\map_background2_co.paa";
    ShowCountourInterval = 0;
    scaleDefault = 0.1;
    onMouseButtonClick = "";
    onMouseButtonDblClick = "";

    class ActiveMarker {
        color[] = {0.3, 0.1, 0.9, 1};
        size = 100;
    };

    class Legend {
        x = 0.729;
        y = 0.05;
        w = 0.237;
        h = 0.127;
        font = "Zeppelin32";
        sizeEx = 0.0208333;
        colorBackground[] = {0.906, 0.901, 0.88, 0.8};
        color[] = {Dlg_Color_Black, 1};
    };

    class Bunker {
        color[] = {0, 0.35, 0.7, 1};
        icon = "\ca\ui\data\map_bunker_ca.paa";
        size = 14;
        importance = 1.5 * 14 * 0.05;
        coefMin = 0.25;
        coefMax = 4;
    };

    class Bush {
        icon = "\ca\ui\data\map_bush_ca.paa";
        color[] = {0.55, 0.64, 0.43, 1};
        size = 14;
        importance = 0.2 * 14 * 0.05;
        coefMin = 0.25;
        coefMax = 4;
    };

    class BusStop {
        icon = "\ca\ui\data\map_busstop_ca.paa";
        color[] = {0, 0, 1, 1};
        size = 10;
        importance = 1 * 10 * 0.05;
        coefMin = 0.25;
        coefMax = 4;
    };

    class Command {
        icon = "#(argb,8,8,3)color(1,1,1,1)";
        color[] = {0, 0.9, 0, 1};
        size = 18;
        importance = 1;
        coefMin = 1;
        coefMax = 1;
    };

    class Cross {
        color[] = {0, 0.35, 0.7, 1};
        icon = "\ca\ui\data\map_cross_ca.paa";
        size = 16;
        importance = 0.7 * 16 * 0.05;
        coefMin = 0.25;
        coefMax = 4;
    };

    class Fortress {
        icon = "\ca\ui\data\map_bunker_ca.paa";
        color[] = {0, 0.35, 0.7, 1};
        size = 16;
        importance = 2 * 16 * 0.05;
        coefMin = 0.25;
        coefMax = 4;
    };

    class Fuelstation {
        icon = "\ca\ui\data\map_fuelstation_ca.paa";
        color[] = {1.0, 0.35, 0.35, 1};
        size = 16;
        importance = 2 * 16 * 0.05;
        coefMin = 0.75;
        coefMax = 4;
    };

    class Fountain {
        icon = "\ca\ui\data\map_fountain_ca.paa";
        color[] = {0, 0.35, 0.7, 1};
        size = 12;
        importance = 1 * 12 * 0.05;
        coefMin = 0.25;
        coefMax = 4;
    };

    class Hospital {
        icon = "\ca\ui\data\map_hospital_ca.paa";
        color[] = {0.78, 0, 0.05, 1};
        size = 16;
        importance = 2 * 16 * 0.05;
        coefMin = 0.5;
        coefMax = 4;
    };

    class Chapel {
        icon = "\ca\ui\data\map_chapel_ca.paa";
        color[] = {0, 0.35, 0.7, 1};
        size = 16;
        importance = 1 * 16 * 0.05;
        coefMin = 0.9;
        coefMax = 4;
    };

    class Church {
        icon = "\ca\ui\data\map_church_ca.paa";
        color[] = {0, 0.35, 0.7, 1};
        size = 16;
        importance = 2 * 16 * 0.05;
        coefMin = 0.9;
        coefMax = 4;
    };

    class Lighthouse {
        icon = "\ca\ui\data\map_lighthouse_ca.paa";
        color[] = {0.78, 0, 0.05, 1};
        size = 20;
        importance = 3 * 16 * 0.05;
        coefMin = 0.9;
        coefMax = 4;
    };

    class Quay {
        icon = "\ca\ui\data\map_quay_ca.paa";
        color[] = {0, 0.35, 0.7, 1};
        size = 16;
        importance = 2 * 16 * 0.05;
        coefMin = 0.5;
        coefMax = 4;
    };

    class Rock {
        color[] = {0.35, 0.35, 0.35, 1};
        icon = "\ca\ui\data\map_rock_ca.paa";
        size = 12;
        importance = 0.5 * 12 * 0.05;
        coefMin = 0.25;
        coefMax = 4;
    };

    class Ruin {
        icon = "\ca\ui\data\map_ruin_ca.paa";
        color[] = {0.78, 0, 0.05, 1};
        size = 16;
        importance = 1.2 * 16 * 0.05;
        coefMin = 1;
        coefMax = 4;
    };

    class SmallTree {
        icon = "\ca\ui\data\map_smalltree_ca.paa";
        color[] = {0.55, 0.64, 0.43, 1};
        size = 12;
        importance = 0.6 * 12 * 0.05;
        coefMin = 0.25;
        coefMax = 4;
    };

    class Stack {
        icon = "\ca\ui\data\map_stack_ca.paa";
        color[] = {0, 0.35, 0.7, 1};
        size = 20;
        importance = 2 * 16 * 0.05;
        coefMin = 0.9;
        coefMax = 4;
    };

    class Tree {
        icon = "\ca\ui\data\map_tree_ca.paa";
        color[] = {0.55, 0.64, 0.43, 1};
        size = 12;
        importance = 0.9 * 16 * 0.05;
        coefMin = 0.25;
        coefMax = 4;
    };

    class Tourism {
        icon = "\ca\ui\data\map_tourism_ca.paa";
        color[] = {0.78, 0, 0.05, 1};
        size = 16;
        importance = 1 * 16 * 0.05;
        coefMin = 0.7;
        coefMax = 4;
    };

    class Transmitter {
        icon = "\ca\ui\data\map_transmitter_ca.paa";
        color[] = {0, 0.35, 0.7, 1};
        size = 20;
        importance = 2 * 16 * 0.05;
        coefMin = 0.9;
        coefMax = 4;
    };

    class ViewTower {
        icon = "\ca\ui\data\map_viewtower_ca.paa";
        color[] = {0, 0.35, 0.7, 1};
        size = 16;
        importance = 2.5 * 16 * 0.05;
        coefMin = 0.5;
        coefMax = 4;
    };

    class Watertower {
        icon = "\ca\ui\data\map_watertower_ca.paa";
        color[] = {0, 0.35, 0.7, 1};
        size = 32;
        importance = 1.2 * 16 * 0.05;
        coefMin = 0.9;
        coefMax = 4;
    };

    class Waypoint {
        icon = "\ca\ui\data\map_waypoint_ca.paa";
        color[] = {0, 0.35, 0.7, 1};
        size = 32;
        coefMin = 1.00;
        coefMax = 1.00;
        importance = 1.00;
    };

    class WaypointCompleted {
        icon = "\ca\ui\data\map_waypoint_completed_ca.paa";
        color[] = {Dlg_Color_Black, 1};
        size = 24;
        importance = 1.00;
        coefMin = 1.00;
        coefMax = 1.00;
    };
	
	//ARMA2
	class CustomMark {
		icon = "\ca\ui\data\map_cross_ca.paa";
		color[] = {0.55, 0.64, 0.43, 1};
		size = 16;
		importance = 0.7 * 16 * 0.05;
		coefMin = 0.25;
		coefMax = 4;
	};
	

};
//-------------------------------------

class RscMap: RscMapControl {
	moveOnEdges = 0;
	x = 0;
	y = 0;
	w = 0.83;
	h = 1;
}; 
		
/* 		{
    access = ReadAndWrite;

    class controls {

        class Map 
    };
}; */

class MatrixButton : RscButton {

	colorText[] = {MATRIX_GREEN, 1};
    colorFocused[] = {0, 0.1,0, 1}; // border color for focused state
    colorDisabled[] = {0.5, 0.5, 0.5, 1}; // text color for disabled state
    colorBackground[] = {0, 0, 0, 0.8};
    colorBackgroundDisabled[] = {0, 0, 0, 0.8};   // background color for disabled state
    colorBackgroundActive[] = { 0, 0, 0, 1 };    // background color for active state
	colorShadow[] = {MATRIX_GREEN, 0.5};
    colorBorder[] = {1, 1, 1, 1};
   
	
};

class MatrixListBox : RscListBox {

    color[] = {MATRIX_GREEN, 1};
    colorText[] = {MATRIX_GREEN, 1};
    colorBackground[] = {Dlg_Color_White, 1};
    colorSelect[] = {0, 0, 0, 1};
    colorSelectBackground[] = {MATRIX_GREEN, 1};
	colorFocused[] = {1,0,0,0};
	colorShadow[] = {0.6, 0.6, 0.6, 0.8};
	colorBorder[] = {0.5,0,0,1};
    colorDisabled[] = {0.5, 0.5, 0.5, 1}; // text color for disabled state
   
   class ScrollBar
	{
		color[] = {MATRIX_GREEN, 1};
		colorActive[] = {0.5,0,0,1};
		colorDisabled[] = {0.5,0,0,1};		
	};
	
};

class MatrixCombo : RscCombo {

    color[] = {MATRIX_GREEN, 1};
    colorText[] = {MATRIX_GREEN, 1};
    colorBackground[] = {Dlg_Color_White, 1};
    colorSelect[] = {0, 0, 0, 1};
    colorSelectBackground[] = {MATRIX_GREEN, 1};
	colorFocused[] = {1,0,0,0};
	colorShadow[] = {0.6, 0.6, 0.6, 0.8};
	colorBorder[] = {0.5,0,0,1};
    colorDisabled[] = {0.5, 0.5, 0.5, 1}; // text color for disabled state
   
   class ScrollBar
	{
		color[] = {MATRIX_GREEN, 1};
		colorActive[] = {0.5,0,0,1};
		colorDisabled[] = {0.5,0,0,1};		
	};
	
};

class MatrixText { 
	idc = -1;
	type = CT_STATIC; // defined constant 
	style = ST_LEFT; // defined constant 
	colorText[] = { MATRIX_GREEN, 1 }; 
	colorBackground[] = { 0,0,0, 0 }; 
	font = FontM; // defined constant 
	sizeEx = ControlFontSize; 
	x = 0.3; 
	y = 0.1; 
	w = 0.4; 
	h = 0.03; 
	text = ""; 
};

//-------------------------------------


